package com.mask.sca.swagger;

import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerBaseConfig {
    public Docket buildDocket(String basePackage, String groupName, String title, String description) {
        return new Docket(DocumentationType.OAS_30)
                .groupName(groupName)
                .select()
                .apis(RequestHandlerSelectors.basePackage(basePackage))
                .paths(PathSelectors.any())
                .build()
                .apiInfo(new springfox.documentation.service.ApiInfo(
                        title,
                        description,
                        "1.0",
                        null,
                        null,
                        null,
                        null,
                        java.util.Collections.emptyList()
                ));
    }
} 